import { Consumer } from '../context'
import { ICreateContent } from '../data'
import Item from './item'
const List = () => {
  return <Consumer>
    {
      (value: ICreateContent | null) => {
        const { todoList } = value as ICreateContent
        return (
          todoList && todoList.map(item => {
            return (<Item key={item.id} data={item}></Item>)
          })
        )
      }
    }
  </Consumer>
}

export default List